using ReflectionStudio.Core.Events;
using System.Data;
using System.Data.OracleClient;
using System;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{ 
    public partial class VVVTLIEF
    {
        public void SetUpNewRow(ref DataRow dwReturn)
        {

            switch (app.company)
            {
                case "YGR":
                case "YCC":
                default:
                    #region=========
                    dwReturn["VVTMANDANT"] = "00";
                    dwReturn["VVTAUFTYP"] = " ";
                    dwReturn["VVTAUFKRS"] = "  ";
                    dwReturn["VVTAUFLFD"] = "000000";
                    dwReturn["VVTAUFPOS"] = "000";
                    dwReturn["VVTTEILNR"] = "0000";
                    dwReturn["VVTLOVON"] = "01";
                    dwReturn["VVTLOAN"] = "  ";
                    dwReturn["VVTTEILNRAN"] = "0";
                    dwReturn["VVTABHAENGIG"] = "0";
                    dwReturn["VVTLOABH1"] = "  ";
                    dwReturn["VVTLOABH2"] = "  ";
                    dwReturn["VVTPRODST"] = "M";
                    dwReturn["VVTKZINLEXP"] = "I";
                    dwReturn["VVTLAND"] = "CN ";
                    dwReturn["VVTPLZ"] = "            ";
                    dwReturn["VVTKUNDNRL"] = "00000000";
                    dwReturn["VVTADRSLL"] = "        ";
                    dwReturn["VVTLIEFSCH"] = "00000000";
                    dwReturn["VVTLIEFSCHPOS"] = "000";
                    dwReturn["VVTKUNDNRR"] = "00000000";
                    dwReturn["VVTADRSLR"] = "        ";
                    dwReturn["VVTRENR"] = "00000000";
                    dwReturn["VVTPFRENR"] = "00000000";
                    dwReturn["VVTME"] = "M  ";
                    dwReturn["VVTANZSTK"] = "2";
                    dwReturn["VVTMTR"] = "0";
                    dwReturn["VVTKG"] = "0000000000";
                    dwReturn["VVTQM"] = "0000000000";
                    dwReturn["VVTVOLUMEN"] = "0";
                    dwReturn["VVTRUECKANZSTK"] = "2";
                    dwReturn["VVTRUECKMTR"] = "0";
                    dwReturn["VVTRUECKKG"] = "0000000000";
                    dwReturn["VVTRUECKQM"] = "0000001600";
                    dwReturn["VVTANZVP"] = "0";
                    dwReturn["VVTLB1"] = "BS";
                    dwReturn["VVTLB2"] = "  ";
                    dwReturn["VVTLB3"] = "  ";
                    dwReturn["VVTLB4"] = "  ";
                    dwReturn["VVTLB5"] = "  ";
                    dwReturn["VVTLB6"] = "  ";
                    dwReturn["VVTZAHLBED"] = "100";
                    dwReturn["VVTVALUTA"] = "0";
                    dwReturn["VVTVALDAT"] = "0";
                    dwReturn["VVTEKON"] = "        ";
                    dwReturn["VVTLIEFBED"] = "CIF";
                    dwReturn["VVTLANDU"] = "   ";
                    dwReturn["VVTPLZU"] = "            ";
                    dwReturn["VVTORTU"] = "                                        ";
                    dwReturn["VVTBZU"] = "  ";
                    dwReturn["VVTBZBEZU"] = "             ";
                    dwReturn["VVTCOUNTYU"] = "    ";
                    dwReturn["VVTCITYU"] = "    ";
                    dwReturn["VVTVERSART"] = "   ";
                    dwReturn["VVTVERPART"] = "1  ";
                    dwReturn["VVTLIEFSCHGRP"] = " ";
                    dwReturn["VVTSTKPA"] = "999";
                    dwReturn["VVTSPED"] = "   ";
                    dwReturn["VVTPRKZ"] = "  ";
                    dwReturn["VVTDRKZ"] = " ";
                    dwReturn["VVTDRDAT"] = "0";
                    dwReturn["VVTAFOLGEV"] = "0";
                    dwReturn["VVTVB"] = "   ";
                    dwReturn["VVTORT"] = "                                        ";
                    dwReturn["VVTBZ"] = "  ";
                    dwReturn["VVTBZBEZ"] = "             ";
                    dwReturn["VVTCOUNTY"] = "    ";
                    dwReturn["VVTCITY"] = "    ";
                    dwReturn["VVTREGRP"] = " ";
                    dwReturn["VVTKDVKL"] = "   ";
                    dwReturn["VVTANAME1"] = "                                        ";
                    dwReturn["VVTANAME2"] = "                                        ";
                    dwReturn["VVTASTRASSE1"] = "                                        ";
                    dwReturn["VVTASTRASSE2"] = "                                        ";
                    dwReturn["VVTALAND"] = "   ";
                    dwReturn["VVTAPLZ"] = "            ";
                    dwReturn["VVTAORT"] = "                                        ";
                    dwReturn["VVTABZ"] = "  ";
                    dwReturn["VVTABZBEZ"] = "             ";
                    dwReturn["VVTACOUNTY"] = "    ";
                    dwReturn["VVTACITY"] = "    ";
                    dwReturn["VVTKZVVERP"] = "N";
                    dwReturn["VVTPRIO"] = "9";
                    dwReturn["VVTKUNDLO"] = "  ";
                    dwReturn["VVTKUNDLB"] = "  ";
                    dwReturn["VVTKUNDLP"] = "        ";
                    dwReturn["VVTKDBEZKZ"] = " ";
                    dwReturn["VVTREPOS"] = "000";
                    dwReturn["VVTVERS"] = " ";
                    dwReturn["VVTPARTIE"] = "       ";
                    dwReturn["VVTPARTIEKZ"] = " ";
                    dwReturn["VVTRESTKZ"] = " ";
                    dwReturn["VVTFORT"] = "0";
                    dwReturn["VVTKDAUFTNR"] = "                    ";
                    dwReturn["VVTKDAUFDAT"] = "0";
                    dwReturn["VVTPOSTYP"] = "   ";
                    dwReturn["VVTKUNDNR"] = "        ";
                    dwReturn["VVTWERK"] = "   ";
                    dwReturn["VVTABT"] = "   ";
                    dwReturn["VVTWAKZ"] = "F";
                    dwReturn["VVTART"] = "                        ";
                    dwReturn["VVTVAR"] = "   ";
                    dwReturn["VVTFARBE"] = "          ";
                    dwReturn["VVTDESS"] = "          ";
                    dwReturn["VVTCOL"] = "          ";
                    dwReturn["VVTBESCH"] = "          ";
                    dwReturn["VVTGROE"] = "       ";
                    dwReturn["VVTAUFM"] = "  ";
                    dwReturn["VVTSETKZ"] = " ";
                    dwReturn["VVTLOHNKD"] = "00000000";
                    dwReturn["VVTKOLL"] = "  N  ";
                    dwReturn["VVTSANZSTK"] = "0";
                    dwReturn["VVTROHMTR"] = "0";
                    dwReturn["VVTBRUTTO"] = "0";
                    dwReturn["VVTNETTO"] = "0";
                    dwReturn["VVTVERDERB"] = "0";
                    dwReturn["VVTFOLGEMTR"] = "0";
                    dwReturn["VVTSOLLTEIL"] = "0";
                    dwReturn["VVTGEBNR"] = "        ";
                    dwReturn["VVTPROGRP"] = "K  ";
                    dwReturn["VVTPLFDAT"] = "0";
                    dwReturn["VVTFBENID"] = "        ";
                    dwReturn["VVTFDAT"] = "0";
                    dwReturn["VVTFZEIT"] = "0";
                    dwReturn["VVTVBDAT"] = "0";
                    dwReturn["VVTLIEFTERM"] = "0";
                    dwReturn["VVTEILAUS"] = " ";
                    dwReturn["VVTFRNETTO"] = "0";
                    dwReturn["VVTHUELTYP"] = "      ";
                    dwReturn["VVTHUELGEW"] = "0";
                    dwReturn["VVTSPULEN"] = "0";
                    dwReturn["VVTNETKG"] = "0";
                    dwReturn["VVTFEUCHTEI"] = "0";
                    dwReturn["VVTFEUCHTES"] = "0";
                    dwReturn["VVTHGEWABZ"] = "J";
                    dwReturn["VVTANZPA"] = "0";
                    dwReturn["VVTTARA"] = "0";
                    dwReturn["VVTBRTGEW"] = "0";
                    dwReturn["VVTPACKTYP"] = "    ";
                    dwReturn["VVTKREDLIM"] = "0000000000";
                    dwReturn["VVTSWING"] = "000403106w";
                    dwReturn["VVTRAITING"] = "   ";
                    dwReturn["VVTVERSICH1"] = "  ";
                    dwReturn["VVTVERSICH2"] = "  ";
                    dwReturn["VVTVERSICH3"] = "  ";
                    dwReturn["VVTVERSICH4"] = "  ";
                    dwReturn["VVTVERSICH5"] = "  ";
                    dwReturn["VVTVERSICH21"] = "  ";
                    dwReturn["VVTVERSICH22"] = "  ";
                    dwReturn["VVTVERSICH23"] = "  ";
                    dwReturn["VVTVERSICH24"] = "  ";
                    dwReturn["VVTVERSICH25"] = "  ";
                    dwReturn["VVTKREDBIS"] = "0";
                    dwReturn["VVTKREDVON"] = "0";
                    dwReturn["VVTLUEBKZ"] = " ";
                    dwReturn["VVTFKNVS"] = " ";
                    dwReturn["VVTFKSPTD"] = "0";
                    dwReturn["VVTFKSPRD"] = "0";
                    dwReturn["VVTROHGEW"] = "0";
                    dwReturn["VVTFERGEW"] = "0";
                    dwReturn["VVTZUSTAND"] = "    ";
                    dwReturn["VVTARTGRP"] = "   ";
                    dwReturn["VVTARTABW"] = " ";
                    dwReturn["VVTAPOS"] = "0000";
                    dwReturn["VVTAUFMSL"] = "  ";
                    dwReturn["VVTZENSUR"] = "  ";
                    dwReturn["VVTPOSEXT"] = "000000";
                    dwReturn["VVTKZZUTEI"] = " ";
                    dwReturn["VVTAKKREDNR"] = "                    ";
                    dwReturn["VVTKDKOMM"] = "               ";
                    dwReturn["VVTCOVPRC"] = "1000";
                    dwReturn["VVTUMSATZ"] = " ";
                    dwReturn["VVTZEUGNIS"] = " ";
                    dwReturn["VVTRESKZ"] = " ";
                    dwReturn["VVTFILLER1"] = "                           ";
                    #endregion
                    break;
                case "JLT":
                    #region
                    dwReturn["VVTMANDANT"] = "00";
                    dwReturn["VVTAUFTYP"] = "K";
                    dwReturn["VVTAUFKRS"] = "  ";
                    dwReturn["VVTAUFLFD"] = "000000";
                    dwReturn["VVTAUFPOS"] = "000";
                    dwReturn["VVTTEILNR"] = "0000";
                    dwReturn["VVTLOVON"] = "01";
                    dwReturn["VVTLOAN"] = "  ";
                    dwReturn["VVTTEILNRAN"] = "0";
                    dwReturn["VVTABHAENGIG"] = "0";
                    dwReturn["VVTLOABH1"] = "  ";
                    dwReturn["VVTLOABH2"] = "  ";
                    dwReturn["VVTPRODST"] = "M";
                    dwReturn["VVTKZINLEXP"] = "E";
                    dwReturn["VVTLAND"] = "   ";
                    dwReturn["VVTPLZ"] = ".           ";
                    dwReturn["VVTKUNDNRL"] = "00000000";
                    dwReturn["VVTADRSLL"] = "        ";
                    dwReturn["VVTLIEFSCH"] = "00000000";
                    dwReturn["VVTLIEFSCHPOS"] = "000";
                    dwReturn["VVTKUNDNRR"] = "00000000";
                    dwReturn["VVTADRSLR"] = "        ";
                    dwReturn["VVTRENR"] = "00000000";
                    dwReturn["VVTPFRENR"] = "00000000";
                    dwReturn["VVTME"] = "YRD";
                    dwReturn["VVTANZSTK"] = "0";
                    dwReturn["VVTMTR"] = "0";
                    dwReturn["VVTKG"] = "0000000000";
                    dwReturn["VVTQM"] = "0000000000";
                    dwReturn["VVTVOLUMEN"] = "0";
                    dwReturn["VVTRUECKANZSTK"] = "0";
                    dwReturn["VVTRUECKMTR"] = "0";
                    dwReturn["VVTRUECKKG"] = "0000000000";
                    dwReturn["VVTRUECKQM"] = "0000000000";
                    dwReturn["VVTANZVP"] = "0";
                    dwReturn["VVTLB1"] = "CP";
                    dwReturn["VVTLB2"] = "  ";
                    dwReturn["VVTLB3"] = "  ";
                    dwReturn["VVTLB4"] = "  ";
                    dwReturn["VVTLB5"] = "  ";
                    dwReturn["VVTLB6"] = "  ";
                    dwReturn["VVTZAHLBED"] = "   ";
                    dwReturn["VVTVALUTA"] = "0";
                    dwReturn["VVTVALDAT"] = "0";
                    dwReturn["VVTEKON"] = "        ";
                    dwReturn["VVTLIEFBED"] = "   ";
                    dwReturn["VVTLANDU"] = "   ";
                    dwReturn["VVTPLZU"] = "            ";
                    dwReturn["VVTORTU"] = "                                        ";
                    dwReturn["VVTBZU"] = "  ";
                    dwReturn["VVTBZBEZU"] = "             ";
                    dwReturn["VVTCOUNTYU"] = "    ";
                    dwReturn["VVTCITYU"] = "    ";
                    dwReturn["VVTVERSART"] = "   ";
                    dwReturn["VVTVERPART"] = "   ";
                    dwReturn["VVTLIEFSCHGRP"] = " ";
                    dwReturn["VVTSTKPA"] = "999";
                    dwReturn["VVTSPED"] = "   ";
                    dwReturn["VVTPRKZ"] = "  ";
                    dwReturn["VVTDRKZ"] = " ";
                    dwReturn["VVTDRDAT"] = "0";
                    dwReturn["VVTAFOLGEV"] = "0";
                    dwReturn["VVTVB"] = "2  ";
                    dwReturn["VVTORT"] = "                                        ";
                    dwReturn["VVTBZ"] = "  ";
                    dwReturn["VVTBZBEZ"] = "             ";
                    dwReturn["VVTCOUNTY"] = "    ";
                    dwReturn["VVTCITY"] = "    ";
                    dwReturn["VVTREGRP"] = " ";
                    dwReturn["VVTKDVKL"] = "   ";
                    dwReturn["VVTANAME1"] = "                                        ";
                    dwReturn["VVTANAME2"] = "                                        ";
                    dwReturn["VVTASTRASSE1"] = "                                        ";
                    dwReturn["VVTASTRASSE2"] = "                                        ";
                    dwReturn["VVTALAND"] = "   ";
                    dwReturn["VVTAPLZ"] = "            ";
                    dwReturn["VVTAORT"] = "                                        ";
                    dwReturn["VVTABZ"] = "  ";
                    dwReturn["VVTABZBEZ"] = "             ";
                    dwReturn["VVTACOUNTY"] = "    ";
                    dwReturn["VVTACITY"] = "    ";
                    dwReturn["VVTKZVVERP"] = "N";
                    dwReturn["VVTPRIO"] = "9";
                    dwReturn["VVTKUNDLO"] = "  ";
                    dwReturn["VVTKUNDLB"] = "  ";
                    dwReturn["VVTKUNDLP"] = "        ";
                    dwReturn["VVTKDBEZKZ"] = " ";
                    dwReturn["VVTREPOS"] = "000";
                    dwReturn["VVTVERS"] = " ";
                    dwReturn["VVTPARTIE"] = "       ";
                    dwReturn["VVTPARTIEKZ"] = " ";
                    dwReturn["VVTRESTKZ"] = " ";
                    dwReturn["VVTFORT"] = "0";
                    dwReturn["VVTKDAUFTNR"] = "                    ";
                    dwReturn["VVTKDAUFDAT"] = "0";
                    dwReturn["VVTPOSTYP"] = "   ";
                    dwReturn["VVTKUNDNR"] = "        ";
                    dwReturn["VVTWERK"] = "   ";
                    dwReturn["VVTABT"] = "   ";
                    dwReturn["VVTWAKZ"] = "F";
                    dwReturn["VVTART"] = "                        ";
                    dwReturn["VVTVAR"] = "   ";
                    dwReturn["VVTFARBE"] = "1         ";
                    dwReturn["VVTDESS"] = "          ";
                    dwReturn["VVTCOL"] = "          ";
                    dwReturn["VVTBESCH"] = "          ";
                    dwReturn["VVTGROE"] = "       ";
                    dwReturn["VVTAUFM"] = "  ";
                    dwReturn["VVTSETKZ"] = " ";
                    dwReturn["VVTLOHNKD"] = "00000000";
                    dwReturn["VVTKOLL"] = "     ";
                    dwReturn["VVTSANZSTK"] = "0";
                    dwReturn["VVTROHMTR"] = "0";
                    dwReturn["VVTBRUTTO"] = "0";
                    dwReturn["VVTNETTO"] = "0";
                    dwReturn["VVTVERDERB"] = "0";
                    dwReturn["VVTFOLGEMTR"] = "0";
                    dwReturn["VVTSOLLTEIL"] = "0";
                    dwReturn["VVTGEBNR"] = "        ";
                    dwReturn["VVTPROGRP"] = "MS ";
                    dwReturn["VVTPLFDAT"] = "0";
                    dwReturn["VVTFBENID"] = "        ";
                    dwReturn["VVTFDAT"] = "0";
                    dwReturn["VVTFZEIT"] = "0";
                    dwReturn["VVTVBDAT"] = "0";
                    dwReturn["VVTLIEFTERM"] = "0";
                    dwReturn["VVTEILAUS"] = " ";
                    dwReturn["VVTFRNETTO"] = "0";
                    dwReturn["VVTHUELTYP"] = "      ";
                    dwReturn["VVTHUELGEW"] = "0";
                    dwReturn["VVTSPULEN"] = "0";
                    dwReturn["VVTNETKG"] = "0000000000";
                    dwReturn["VVTFEUCHTEI"] = "0";
                    dwReturn["VVTFEUCHTES"] = "0";
                    dwReturn["VVTHGEWABZ"] = "J";
                    dwReturn["VVTANZPA"] = "0";
                    dwReturn["VVTTARA"] = "0";
                    dwReturn["VVTBRTGEW"] = "0";
                    dwReturn["VVTPACKTYP"] = "    ";
                    dwReturn["VVTKREDLIM"] = "0000000000";
                    dwReturn["VVTSWING"] = "0000000000";
                    dwReturn["VVTRAITING"] = "   ";
                    dwReturn["VVTVERSICH1"] = "  ";
                    dwReturn["VVTVERSICH2"] = "  ";
                    dwReturn["VVTVERSICH3"] = "  ";
                    dwReturn["VVTVERSICH4"] = "  ";
                    dwReturn["VVTVERSICH5"] = "  ";
                    dwReturn["VVTVERSICH21"] = "  ";
                    dwReturn["VVTVERSICH22"] = "  ";
                    dwReturn["VVTVERSICH23"] = "  ";
                    dwReturn["VVTVERSICH24"] = "  ";
                    dwReturn["VVTVERSICH25"] = "  ";
                    dwReturn["VVTKREDBIS"] = "0";
                    dwReturn["VVTKREDVON"] = "0";
                    dwReturn["VVTLUEBKZ"] = " ";
                    dwReturn["VVTFKNVS"] = " ";
                    dwReturn["VVTFKSPTD"] = "0";
                    dwReturn["VVTFKSPRD"] = "0";
                    dwReturn["VVTROHGEW"] = "0";
                    dwReturn["VVTFERGEW"] = "0";
                    dwReturn["VVTZUSTAND"] = "    ";
                    dwReturn["VVTARTGRP"] = "1  ";
                    dwReturn["VVTARTABW"] = " ";
                    dwReturn["VVTAPOS"] = "0000";
                    dwReturn["VVTAUFMSL"] = "  ";
                    dwReturn["VVTZENSUR"] = "  ";
                    dwReturn["VVTPOSEXT"] = "000000";
                    dwReturn["VVTKZZUTEI"] = " ";
                    dwReturn["VVTAKKREDNR"] = "                    ";
                    dwReturn["VVTKDKOMM"] = "               ";
                    dwReturn["VVTCOVPRC"] = "1000";
                    dwReturn["VVTUMSATZ"] = " ";
                    dwReturn["VVTZEUGNIS"] = " ";
                    dwReturn["VVTRESKZ"] = " ";
                    dwReturn["VVTFILLER1"] = "                           ";
                    #endregion
                    break;
            }
        }

        public DataRow Convert2VVTLIEF(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryVVTLIEF(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
                    dwReturn["VVTMANDANT"] = " ".PadRight(2);
                    dwReturn["VVTAUFTYP"] = " ".PadRight(1);
                    dwReturn["VVTAUFKRS"] = " ".PadRight(2);
                    dwReturn["VVTAUFLFD"] = " ".PadRight(6);
                    dwReturn["VVTAUFPOS"] = " ".PadRight(3);
                    dwReturn["VVTTEILNR"] = " ".PadRight(4);
                    dwReturn["VVTLOVON"] = " ".PadRight(2);
                    dwReturn["VVTLOAN"] = " ".PadRight(2);
                    dwReturn["VVTTEILNRAN"] = " ".PadRight(0);
                    dwReturn["VVTABHAENGIG"] = " ".PadRight(0);
                    dwReturn["VVTLOABH1"] = " ".PadRight(2);
                    dwReturn["VVTLOABH2"] = " ".PadRight(2);
                    dwReturn["VVTPRODST"] = " ".PadRight(1);
                    dwReturn["VVTKZINLEXP"] = " ".PadRight(1);
                    dwReturn["VVTLAND"] = " ".PadRight(3);
                    dwReturn["VVTPLZ"] = " ".PadRight(12);
                    dwReturn["VVTKUNDNRL"] = " ".PadRight(8);
                    dwReturn["VVTADRSLL"] = " ".PadRight(8);
                    dwReturn["VVTLIEFSCH"] = " ".PadRight(8);
                    dwReturn["VVTLIEFSCHPOS"] = " ".PadRight(3);
                    dwReturn["VVTKUNDNRR"] = " ".PadRight(8);
                    dwReturn["VVTADRSLR"] = " ".PadRight(8);
                    dwReturn["VVTRENR"] = " ".PadRight(8);
                    dwReturn["VVTPFRENR"] = " ".PadRight(8);
                    dwReturn["VVTME"] = " ".PadRight(3);
                    dwReturn["VVTANZSTK"] = " ".PadRight(0);
                    dwReturn["VVTMTR"] = " ".PadRight(0);
                    dwReturn["VVTKG"] = " ".PadRight(10);
                    dwReturn["VVTQM"] = " ".PadRight(10);
                    dwReturn["VVTVOLUMEN"] = " ".PadRight(0);
                    dwReturn["VVTRUECKANZSTK"] = " ".PadRight(0);
                    dwReturn["VVTRUECKMTR"] = " ".PadRight(0);
                    dwReturn["VVTRUECKKG"] = " ".PadRight(10);
                    dwReturn["VVTRUECKQM"] = " ".PadRight(10);
                    dwReturn["VVTANZVP"] = " ".PadRight(0);
                    dwReturn["VVTLB1"] = " ".PadRight(2);
                    dwReturn["VVTLB2"] = " ".PadRight(2);
                    dwReturn["VVTLB3"] = " ".PadRight(2);
                    dwReturn["VVTLB4"] = " ".PadRight(2);
                    dwReturn["VVTLB5"] = " ".PadRight(2);
                    dwReturn["VVTLB6"] = " ".PadRight(2);
                    dwReturn["VVTZAHLBED"] = " ".PadRight(3);
                    dwReturn["VVTVALUTA"] = " ".PadRight(0);
                    dwReturn["VVTVALDAT"] = " ".PadRight(0);
                    dwReturn["VVTEKON"] = " ".PadRight(8);
                    dwReturn["VVTLIEFBED"] = " ".PadRight(3);
                    dwReturn["VVTLANDU"] = " ".PadRight(3);
                    dwReturn["VVTPLZU"] = " ".PadRight(12);
                    dwReturn["VVTORTU"] = " ".PadRight(40);
                    dwReturn["VVTBZU"] = " ".PadRight(2);
                    dwReturn["VVTBZBEZU"] = " ".PadRight(13);
                    dwReturn["VVTCOUNTYU"] = " ".PadRight(4);
                    dwReturn["VVTCITYU"] = " ".PadRight(4);
                    dwReturn["VVTVERSART"] = " ".PadRight(3);
                    dwReturn["VVTVERPART"] = " ".PadRight(3);
                    dwReturn["VVTLIEFSCHGRP"] = " ".PadRight(1);
                    dwReturn["VVTSTKPA"] = " ".PadRight(0);
                    dwReturn["VVTSPED"] = " ".PadRight(3);
                    dwReturn["VVTPRKZ"] = " ".PadRight(2);
                    dwReturn["VVTDRKZ"] = " ".PadRight(1);
                    dwReturn["VVTDRDAT"] = " ".PadRight(0);
                    dwReturn["VVTAFOLGEV"] = " ".PadRight(0);
                    dwReturn["VVTVB"] = " ".PadRight(3);
                    dwReturn["VVTORT"] = " ".PadRight(40);
                    dwReturn["VVTBZ"] = " ".PadRight(2);
                    dwReturn["VVTBZBEZ"] = " ".PadRight(13);
                    dwReturn["VVTCOUNTY"] = " ".PadRight(4);
                    dwReturn["VVTCITY"] = " ".PadRight(4);
                    dwReturn["VVTREGRP"] = " ".PadRight(1);
                    dwReturn["VVTKDVKL"] = " ".PadRight(3);
                    dwReturn["VVTANAME1"] = " ".PadRight(40);
                    dwReturn["VVTANAME2"] = " ".PadRight(40);
                    dwReturn["VVTASTRASSE1"] = " ".PadRight(40);
                    dwReturn["VVTASTRASSE2"] = " ".PadRight(40);
                    dwReturn["VVTALAND"] = " ".PadRight(3);
                    dwReturn["VVTAPLZ"] = " ".PadRight(12);
                    dwReturn["VVTAORT"] = " ".PadRight(40);
                    dwReturn["VVTABZ"] = " ".PadRight(2);
                    dwReturn["VVTABZBEZ"] = " ".PadRight(13);
                    dwReturn["VVTACOUNTY"] = " ".PadRight(4);
                    dwReturn["VVTACITY"] = " ".PadRight(4);
                    dwReturn["VVTKZVVERP"] = " ".PadRight(1);
                    dwReturn["VVTPRIO"] = " ".PadRight(1);
                    dwReturn["VVTKUNDLO"] = " ".PadRight(2);
                    dwReturn["VVTKUNDLB"] = " ".PadRight(2);
                    dwReturn["VVTKUNDLP"] = " ".PadRight(8);
                    dwReturn["VVTKDBEZKZ"] = " ".PadRight(1);
                    dwReturn["VVTREPOS"] = " ".PadRight(3);
                    dwReturn["VVTVERS"] = " ".PadRight(1);
                    dwReturn["VVTPARTIE"] = " ".PadRight(7);
                    dwReturn["VVTPARTIEKZ"] = " ".PadRight(1);
                    dwReturn["VVTRESTKZ"] = " ".PadRight(1);
                    dwReturn["VVTFORT"] = " ".PadRight(0);
                    dwReturn["VVTKDAUFTNR"] = " ".PadRight(20);
                    dwReturn["VVTKDAUFDAT"] = " ".PadRight(0);
                    dwReturn["VVTPOSTYP"] = " ".PadRight(3);
                    dwReturn["VVTKUNDNR"] = " ".PadRight(8);
                    dwReturn["VVTWERK"] = " ".PadRight(3);
                    dwReturn["VVTABT"] = " ".PadRight(3);
                    dwReturn["VVTWAKZ"] = " ".PadRight(1);
                    dwReturn["VVTART"] = " ".PadRight(24);
                    dwReturn["VVTVAR"] = " ".PadRight(3);
                    dwReturn["VVTFARBE"] = " ".PadRight(10);
                    dwReturn["VVTDESS"] = " ".PadRight(10);
                    dwReturn["VVTCOL"] = " ".PadRight(10);
                    dwReturn["VVTBESCH"] = " ".PadRight(10);
                    dwReturn["VVTGROE"] = " ".PadRight(7);
                    dwReturn["VVTAUFM"] = " ".PadRight(2);
                    dwReturn["VVTSETKZ"] = " ".PadRight(1);
                    dwReturn["VVTLOHNKD"] = " ".PadRight(8);
                    dwReturn["VVTKOLL"] = " ".PadRight(5);
                    dwReturn["VVTSANZSTK"] = " ".PadRight(0);
                    dwReturn["VVTROHMTR"] = " ".PadRight(0);
                    dwReturn["VVTBRUTTO"] = " ".PadRight(0);
                    dwReturn["VVTNETTO"] = " ".PadRight(0);
                    dwReturn["VVTVERDERB"] = " ".PadRight(0);
                    dwReturn["VVTFOLGEMTR"] = " ".PadRight(0);
                    dwReturn["VVTSOLLTEIL"] = " ".PadRight(0);
                    dwReturn["VVTGEBNR"] = " ".PadRight(8);
                    dwReturn["VVTPROGRP"] = " ".PadRight(3);
                    dwReturn["VVTPLFDAT"] = " ".PadRight(0);
                    dwReturn["VVTFBENID"] = " ".PadRight(8);
                    dwReturn["VVTFDAT"] = " ".PadRight(0);
                    dwReturn["VVTFZEIT"] = " ".PadRight(0);
                    dwReturn["VVTVBDAT"] = " ".PadRight(0);
                    dwReturn["VVTLIEFTERM"] = " ".PadRight(0);
                    dwReturn["VVTEILAUS"] = " ".PadRight(1);
                    dwReturn["VVTFRNETTO"] = " ".PadRight(0);
                    dwReturn["VVTHUELTYP"] = " ".PadRight(6);
                    dwReturn["VVTHUELGEW"] = " ".PadRight(0);
                    dwReturn["VVTSPULEN"] = " ".PadRight(0);
                    dwReturn["VVTNETKG"] = " ".PadRight(10);
                    dwReturn["VVTFEUCHTEI"] = " ".PadRight(0);
                    dwReturn["VVTFEUCHTES"] = " ".PadRight(0);
                    dwReturn["VVTHGEWABZ"] = " ".PadRight(1);
                    dwReturn["VVTANZPA"] = " ".PadRight(0);
                    dwReturn["VVTTARA"] = " ".PadRight(0);
                    dwReturn["VVTBRTGEW"] = " ".PadRight(0);
                    dwReturn["VVTPACKTYP"] = " ".PadRight(4);
                    dwReturn["VVTKREDLIM"] = " ".PadRight(10);
                    dwReturn["VVTSWING"] = " ".PadRight(10);
                    dwReturn["VVTRAITING"] = " ".PadRight(3);
                    dwReturn["VVTVERSICH1"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH2"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH3"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH4"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH5"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH21"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH22"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH23"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH24"] = " ".PadRight(2);
                    dwReturn["VVTVERSICH25"] = " ".PadRight(2);
                    dwReturn["VVTKREDBIS"] = " ".PadRight(0);
                    dwReturn["VVTKREDVON"] = " ".PadRight(0);
                    dwReturn["VVTLUEBKZ"] = " ".PadRight(1);
                    dwReturn["VVTFKNVS"] = " ".PadRight(1);
                    dwReturn["VVTFKSPTD"] = " ".PadRight(0);
                    dwReturn["VVTFKSPRD"] = " ".PadRight(0);
                    dwReturn["VVTROHGEW"] = " ".PadRight(0);
                    dwReturn["VVTFERGEW"] = " ".PadRight(0);
                    dwReturn["VVTZUSTAND"] = " ".PadRight(4);
                    dwReturn["VVTARTGRP"] = " ".PadRight(3);
                    dwReturn["VVTARTABW"] = " ".PadRight(1);
                    dwReturn["VVTAPOS"] = " ".PadRight(4);
                    dwReturn["VVTAUFMSL"] = " ".PadRight(2);
                    dwReturn["VVTZENSUR"] = " ".PadRight(2);
                    dwReturn["VVTPOSEXT"] = " ".PadRight(6);
                    dwReturn["VVTKZZUTEI"] = " ".PadRight(1);
                    dwReturn["VVTAKKREDNR"] = " ".PadRight(20);
                    dwReturn["VVTKDKOMM"] = " ".PadRight(15);
                    dwReturn["VVTCOVPRC"] = " ".PadRight(4);
                    dwReturn["VVTUMSATZ"] = " ".PadRight(1);
                    dwReturn["VVTZEUGNIS"] = " ".PadRight(1);
                    dwReturn["VVTRESKZ"] = " ".PadRight(1);
                    dwReturn["VVTFILLER1"] = " ".PadRight(27);
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }

        public void DeleteVVTLIEF(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "DELETE FROM VVTLIEF   "
                    + " WHERE  VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND VVTAUFKRS =:VVTAUFKRS:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 1:
                    or1.CommandText = "DELETE FROM VVTLIEF   "
                    + " WHERE  VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND VVTAUFKRS =:VVTAUFKRS: AND VVTAUFLFD=:VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: AND VVTLIEFSCH=:VVTLIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                case 2:
                    or1.CommandText = "DELETE FROM VVTLIEF   "
                    + " WHERE  VVTMANDANT=:VVTMANDANT:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        }

        public void MapVVTLIEF(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }

        public void SaveVVTLIEF(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryVVTLIEF(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapVVTLIEF(ref dwLocal, dwData);

            if (!flgExist)
            {
                InsertVVTLIEF(dwLocal, ITXDBVERSION);
            }
            UpdateVVTLIEF(dwLocal);
        }
        public void InsertVVTLIEF(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                case "YCC":
                default:
                    or1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TTO,VVTNETTO,VVTVERDERB,VVTFOLGEMTR,VVTSOLLTEIL,VVTGEBNR,VVTPROGRP,VVTPLFDAT,VVTFBENID,VVTFDAT,VVTFZEIT,VVTVBDAT,VVTLIEFTERM,VVTEILAUS,VVTFRNETTO,VVTHUELTYP,VVTHUELGEW,VVTSPULEN,VVTNETKG,VVTFEUCHTEI,VVTFEUCHTES,VVTHGEWABZ,VVTANZPA,VVTTARA,VVTBRTGEW,VVTPACKTYP,VVTKREDLIM,VVTSWING,VVTRAITING,VVTVERSICH1,VVTVERSICH2,VVTVERSICH3,VVTVERSICH4,VVTVERSICH5,VVTVERSICH21,VVTVERSICH22,VVTVERSICH23,VVTVERSICH24,VVTVERSICH25,VVTKREDBIS,VVTKREDVON,VVTLUEBKZ,VVTFKNVS,VVTFKSPTD,VVTFKSPRD,VVTROHGEW,VVTFERGEW,VVTZUSTAND,VVTARTGRP,VVTARTABW,VVTAPOS,VVTAUFMSL,VVTZENSUR,VVTPOSEXT,VVTKZZUTEI,VVTAKKREDNR,VVTKDKOMM,VVTCOVPRC,VVTUMSATZ,VVTZEUGNIS,VVTRESKZ,VVTFILLER1)"
                    + " VALUES (:VVTMANDANT:,:VVTAUFTYP:,:VVTAUFKRS:,:VVTAUFLFD:,:VVTAUFPOS:,:VVTTEILNR:,:VVTLOVON:,:VVTLOAN:,:VVTTEILNRAN:,:VVTABHAENGIG:,:VVTLOABH1:,:VVTLOABH2:,:VVTPRODST:,:VVTKZINLEXP:,:VVTLAND:,:VVTPLZ:,:VVTKUNDNRL:,:VVTADRSLL:,:VVTLIEFSCH:,:VVTLIEFSCHPOS:,:VVTKUNDNRR:,:VVTADRSLR:,:VVTRENR:,:VVTPFRENR:,:VVTME:,:VVTANZSTK:,:VVTMTR:,:VVTKG:,:VVTQM:,:VVTVOLUMEN:,:VVTRUECKANZSTK:,:VVTRUECKMTR:,:VVTRUECKKG:,:VVTRUECKQM:,:VVTANZVP:,:VVTLB1:,:VVTLB2:,:VVTLB3:,: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HTEI:,:VVTFEUCHTES:,:VVTHGEWABZ:,:VVTANZPA:,:VVTTARA:,:VVTBRTGEW:,:VVTPACKTYP:,:VVTKREDLIM:,:VVTSWING:,:VVTRAITING:,:VVTVERSICH1:,:VVTVERSICH2:,:VVTVERSICH3:,:VVTVERSICH4:,:VVTVERSICH5:,:VVTVERSICH21:,:VVTVERSICH22:,:VVTVERSICH23:,:VVTVERSICH24:,:VVTVERSICH25:,:VVTKREDBIS:,:VVTKREDVON:,:VVTLUEBKZ:,:VVTFKNVS:,:VVTFKSPTD:,:VVTFKSPRD:,:VVTROHGEW:,:VVTFERGEW:,:VVTZUSTAND:,:VVTARTGRP:,:VVTARTABW:,:VVTAPOS:,:VVTAUFMSL:,:VVTZENSUR:,:VVTPOSEXT:,:VVTKZZUTEI:,:VVTAKKREDNR:,:VVTKDKOMM:,:VVTCOVPRC:,:VVTUMSATZ:,:VVTZEUGNIS:,:VVTRESKZ:,:VVTFILLER1:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case "JLT":
                    or1.CommandText = "INSERT INTO VVTLIEF ( VVTMANDANT,VVTAUFTYP,VVTAUFKRS,VVTAUFLFD,VVTAUFPOS,VVTTEILNR,VVTLOVON,VVTLOAN,VVTTEILNRAN,VVTABHAENGIG,VVTLOABH1,VVTLOABH2,VVTPRODST,VVTKZINLEXP,VVTLAND,VVTPLZ,VVTKUNDNRL,VVTADRSLL,VVTLIEFSCH,VVTLIEFSCHPOS,VVTKUNDNRR,VVTADRSLR,VVTRENR,VVTPFRENR,VVTME,VVTANZSTK,VVTMTR,VVTKG,VVTQM,VVTVOLUMEN,VVTRUECKANZSTK,VVTRUECKMTR,VVTRUECKKG,VVTRUECKQM,VVTANZVP,VVTLB1,VVTLB2,VVTLB3,VVTLB4,VVTLB5,VVTLB6,VVTZAHLBED,VVTVALUTA,VVTVALDAT,VVTEKON,VVTLIEFBED,VVTLANDU,VVTPLZU,VVTORTU,VVTBZU,VVTBZBEZU,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TRESKZ:,:VVTFILLER1:)";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    break;
            }

            Connect2Proxy(or1);
        }

        public DataSet QueryVVTLIEF(DataRow dwData, int option = 1)
        {

            
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM VVTLIEF WHERE  ROWNUM<2 ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 1:
                    or1.CommandText = "SELECT * FROM VVTLIEF WHERE VVTMANDANT=:VVTMANDANT: AND VVTLIEFSCH=:VVTLIEFSCH: AND VVTLIEFSCHPOS=:VVTLIEFSCHPOS:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 2:
                    or1.CommandText = "SELECT * FROM VVTLIEF   WHERE   VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 3:
                    or1.CommandText = "SELECT * FROM VVTLIEF WHERE VVTMANDANT=:VVTMANDANT: AND VVTLIEFSCH=:VVTLIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 4:
                    or1.CommandText = "SELECT DISTINCT R.VRPRENR,VRPREPOS,VRPAUFKRS,VRPAUFLFD,VRPAUFPOS,VV.*   FROM VRPOS R JOIN VVTLIEF VV ON R.VRPLIEFSCH=VV.VVTLIEFSCH"
                    + " WHERE VRPMANDANT=:VRPMANDANT: AND VRPRENR = :VRPRENR: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 5:
                    or1.CommandText = "SELECT VVLIEFSCH,T.* FROM VVTLIEF T JOIN VVLIEF ON VVLIEFSCH=VVTLIEFSCH WHERE  VVNEUDAT>='" + dwData["DSTART"].ToString() + "' AND VVNEUDAT<='" + dwData["DEND"].ToString() + "' AND VVSTATUS IN (" + dwData["C20"].ToString() + ")";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 6:
                    or1.CommandText = "SELECT P.*   FROM VVTLIEF P  WHERE   VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 7:SResult = QVVT07(dwData);  break;
                case 8:
                    or1.CommandText = "SELECT MAX(VVTTEILNR) AS VVTTEILNR  FROM VVTLIEF P  WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND  VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 9:
                    or1.CommandText = "SELECT VVTLIEFSCH  FROM VVTLIEF P  WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND  VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: AND VVTLIEFSCH=:VVTLIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 10:
                    or1.CommandText = "SELECT * FROM VVTLIEF WHERE  VVTMANDANT=:VVTMANDANT: AND VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: "
                        + " ORDER BY VVTLIEFSCH DESC";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 11:
                    or1.CommandText = "SELECT P.* FROM VVTLIEF P   WHERE  VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: "
                        + " ORDER BY VVTLIEFSCH DESC";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 12:
                    or1.CommandText = "SELECT P.*   FROM VVTLIEF P "
                    +" WHERE    VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS:"
                     + " ORDER BY VVTLIEFSCH DESC";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 13:
                    or1.CommandText = "SELECT  MAX(VVTLIEFSCH) AS VVTLIEFSCH FROM VVTLIEF P   WHERE  VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: "
                        + " ORDER BY VVTLIEFSCH DESC";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 14:
                    or1.CommandText = "select DISTINCT T.VVTLIEFSCH,B.VKPAUFKRS,B.VKPAUFLFD,B.VKPAUFPOS,b.vkpkoll,b.vkpart,b.vkpfarbe,B.VKPKDARTNR,B.VKPKDFARBNR,VAABEZ,  "
                        + " b.vkpmenge1*0.01 as qty,SUM(DECODE(TRIM(B.VKPMEEH),'M',T.VVTMTR*0.01,'KG',T.VVTKG*0.001,'Y',ROUND(T.VVTMTR*0.01/0.9144,1),'YRD',ROUND(T.VVTMTR*0.01/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS) AS VVQTY, "
                        + " to_number(b.vkppreis)*0.001 as price,b.vkpmeeh,b.vkpliefterm as deldat,v.vaabrtvon*0.01 as width,v.vaagewvon*0.01 as weight,  " 
                        + " W.WAFBRTU*0.1 AS TOTWID,W.WAFBRTL*0.1 AS WID,W.WAFGRLFD AS GM,W.WAFGRQM AS SQM,trim(v.vaafiller) as comp, "
                        + " SUM(DECODE(TRIM(B.VKPMEEH),'M',T.VVTMTR*0.01,'KG',T.VVTKG*0.001,'Y',ROUND(T.VVTMTR*0.01/0.9144,1),'YRD',ROUND(T.VVTMTR*0.01/0.9144,1),0)*to_number(b.vkppreis)*0.001+ "
                        + " (c.vkzzuabproz1+c.vkzzuabproz2+c.vkzzuabproz3+c.vkzzuabproz4+c.vkzzuabproz5)*0.0001*DECODE(TRIM(B.VKPMEEH),'M',T.VVTMTR*0.01,'KG',T.VVTKG*0.001,'Y',ROUND(T.VVTMTR*0.01/0.9144,1),'YRD',ROUND(T.VVTMTR*0.01/0.9144,1),0)*to_number(b.vkppreis)*0.001+ "
                        + " (c.vkzzuabwert1+c.vkzzuabwert2+c.vkzzuabwert3+c.vkzzuabwert4+c.vkzzuabwert5)*0.01-  "
                        + " (c.vkzrabproz1+c.vkzrabproz2+c.vkzrabproz3+c.vkzrabproz4+c.vkzrabproz5)*0.0001*DECODE(TRIM(B.VKPMEEH),'M',T.VVTMTR*0.01,'KG',T.VVTKG*0.001,'Y',ROUND(T.VVTMTR*0.01/0.9144,1),'YRD',ROUND(T.VVTMTR*0.01/0.9144,1),0)*to_number(b.vkppreis)*0.001-   "
                        + " (c.vkzverpwert1+c.vkzverpwert2+c.vkzverpwert3+c.vkzverpwert4+c.vkzverpwert5)*0.01)OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS) as value,   "
                        + " decode(c.vkzzuart1,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0255'    "
                        + " and substr(sdkey,3,3)=c.vkzzuart1)||decode(c.vkzzuabproz1,0,to_char(c.vkzzuabwert1*0.01)||'  ',c.vkzzuabproz1*0.01||'%  '))||  "
                        + " decode(c.vkzzuart2,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0255'    "
                        + " and substr(sdkey,3,3)=c.vkzzuart2)||decode(c.vkzzuabproz2,0,to_char(c.vkzzuabwert2*0.01)||'  ',c.vkzzuabproz2*0.01||'%  '))||  "
                        + " decode(c.vkzzuart3,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0255'    "
                        + " and substr(sdkey,3,3)=c.vkzzuart3)||decode(c.vkzzuabproz3,0,to_char(c.vkzzuabwert3*0.01)||'  ',c.vkzzuabproz3*0.01||'%  '))||  "
                        + " decode(c.vkzzuart4,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0255'    "
                        + " and substr(sdkey,3,3)=c.vkzzuart4)||decode(c.vkzzuabproz4,0,to_char(c.vkzzuabwert4*0.01)||'  ',c.vkzzuabproz4*0.01||'%  '))||  "
                        + " decode(c.vkzzuart5,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0255'    "
                        + " and substr(sdkey,3,3)=c.vkzzuart5)||decode(c.vkzzuabproz5,0,to_char(c.vkzzuabwert5*0.01)||'  ',c.vkzzuabproz5*0.01||'%  ')) AS SUR,  "
                        + " decode(c.vkzrabart1,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0243'    "
                        + " and substr(sdkey,3,3)=c.vkzrabart1)||decode(c.vkzrabproz1,0,to_char(c.vkzverpwert1*0.01)||'  ',c.vkzrabproz1*0.01||'%  '))||  "
                        + " decode(c.vkzrabart2,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0243'    "
                        + " and substr(sdkey,3,3)=c.vkzrabart2)||decode(c.vkzrabproz2,0,to_char(c.vkzverpwert2*0.01)||'  ',c.vkzrabproz2*0.01||'%  '))||  "
                        + " decode(c.vkzrabart3,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0243'    "
                        + " and substr(sdkey,3,3)=c.vkzrabart3)||decode(c.vkzrabproz3,0,to_char(c.vkzverpwert3*0.01)||'  ',c.vkzrabproz3*0.01||'%  '))||  "
                        + " decode(c.vkzrabart4,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0243'    "
                        + " and substr(sdkey,3,3)=c.vkzrabart4)||decode(c.vkzrabproz4,0,to_char(c.vkzverpwert4*0.01)||'  ',c.vkzrabproz4*0.01||'%  '))||  "
                        + " decode(c.vkzrabart5,'   ','',(select trim(substr(sddaten,52,10)) from sddat where sdsa = '0243'    "
                        + " and substr(sdkey,3,3)=c.vkzrabart5)||decode(c.vkzrabproz5,0,to_char(c.vkzverpwert5*0.01)||'  ',c.vkzrabproz5*0.01||'%  ')) AS DIS,  "
                        + " (SELECT (X.LSLIEFNA) FROM LIEFDAT X WHERE X.LSMANDANT = W.WAMANDANT AND X.LSLIEFNR = W.WALIEFNR) AS SUPP, " 
                        + " (select stragg(trim(txtktext)) from txtind t1,txtkon t2 where t1.txtimandant = t2.txtkmandant "
                        + " and t1.txtipind = t2.txtkpind and TRIM(t1.txtisind) = B.VKPAUFKRS||B.VKPAUFLFD||B.VKPAUFPOS||'VKT') as REMARK "
                        + " FROM VKPOS B,VKZUAB C,VAART V,WASTAMM W,VVTLIEF T "
                        + " WHERE B.VKPMANDANT = T.VVTMANDANT AND B.VKPAUFKRS=T.VVTAUFKRS AND B.VKPAUFLFD=T.VVTAUFLFD "
                        + " AND B.VKPAUFPOS = T.VVTAUFPOS AND B.VKPSA = '  '    "
                        + " AND B.VKPMANDANT = C.VKZMANDANT AND B.VKPAUFKRS = C.VKZAUFKRS AND B.VKPAUFLFD = C.VKZAUFLFD   "
                        + " AND B.VKPAUFPOS = C.VKZAUFPOS AND C.VKZSA = 'VK'   "
                        + " AND B.VKPMANDANT = V.VAAMANDANT AND B.VKPKOLL = V.VAAKOLL AND B.VKPART = V.VAAART  "
                        + " AND V.VAAMANDANT = W.WAMANDANT(+) AND V.VAADART = W.WAART(+) AND V.VAADVAR = W.WAVAR(+)  "
                        + " AND T.VVTMANDANT = :VVTMANDANT: AND T.VVTAUFKRS = :VVTAUFKRS: AND T.VVTAUFLFD = :VVTAUFLFD: AND T.VVTLIEFSCH = :VVTLIEFSCH: "
                        + " AND T.VVTMTR>0 "
                        + " order by vkpaufpos ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;
                case 15:
                    or1.CommandText = "select distinct T.VVTLIEFSCH,B.VKPAUFKRS,B.VKPAUFLFD,B.VKPAUFPOS,b.vkpkoll,b.vkpart,b.vkpfarbe,B.VKPKDARTNR,B.VKPKDFARBNR, "
                        + " SUM(DECODE(TRIM(B.VKPMEEH),'M', W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS) AS QTY, "
                        + " to_number(b.vkppreis)*0.001 as price,b.vkpmeeh,SUM(1)OVER(PARTITION BY  T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS ) AS PCE, "
                        + " SUM(DECODE(TRIM(B.VKPMEEH),'M',W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS)*to_number(b.vkppreis)*0.001+ "
                        + " (c.vkzzuabproz1+c.vkzzuabproz2+c.vkzzuabproz3+c.vkzzuabproz4+c.vkzzuabproz5)*0.0001*SUM(DECODE(TRIM(B.VKPMEEH),'M',W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS)*to_number(b.vkppreis)*0.001+ "
                        + " (c.vkzzuabwert1+c.vkzzuabwert2+c.vkzzuabwert3+c.vkzzuabwert4+c.vkzzuabwert5)*0.01-  "
                        + " (c.vkzrabproz1+c.vkzrabproz2+c.vkzrabproz3+c.vkzrabproz4+c.vkzrabproz5)*0.0001*SUM(DECODE(TRIM(B.VKPMEEH),'M',W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS)*to_number(b.vkppreis)*0.001-   "
                        + " (c.vkzverpwert1+c.vkzverpwert2+c.vkzverpwert3+c.vkzverpwert4+c.vkzverpwert5)*0.01 as value,  "
                        + " (c.vkzzuabproz1+c.vkzzuabproz2+c.vkzzuabproz3+c.vkzzuabproz4+c.vkzzuabproz5)*0.0001*SUM(DECODE(TRIM(B.VKPMEEH),'M',W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS)*to_number(b.vkppreis)*0.001+ "
                        + " (c.vkzzuabwert1+c.vkzzuabwert2+c.vkzzuabwert3+c.vkzzuabwert4+c.vkzzuabwert5)*0.01-  "
                        + " (c.vkzrabproz1+c.vkzrabproz2+c.vkzrabproz3+c.vkzrabproz4+c.vkzrabproz5)*0.0001*SUM(DECODE(TRIM(B.VKPMEEH),'M',W.WBBISTKLG*0.001,'KG',W.WBBIGEW*0.00001,'Y',ROUND(W.WBBISTKLG*0.001/0.9144,1),'YRD',ROUND(W.WBBISTKLG*0.001/0.9144,1),0))OVER(PARTITION BY T.VVTLIEFSCH,T.VVTAUFKRS,T.VVTAUFLFD,T.VVTAUFPOS)*to_number(b.vkppreis)*0.001-   "
                        + " (c.vkzverpwert1+c.vkzverpwert2+c.vkzverpwert3+c.vkzverpwert4+c.vkzverpwert5)*0.01 as DIS,  "
                        + " (SELECT (X.LSLIEFNA) FROM LIEFDAT X WHERE X.LSMANDANT = S.WAMANDANT AND X.LSLIEFNR = S.WALIEFNR) AS SUPP  "
                        + " FROM VKPOS B,VKZUAB C,VVTLIEF T,WBBST W,WASTAMM S "
                        + " WHERE B.VKPMANDANT = T.VVTMANDANT AND B.VKPAUFKRS=T.VVTAUFKRS AND B.VKPAUFLFD=T.VVTAUFLFD "
                        + " AND B.VKPAUFPOS = T.VVTAUFPOS AND B.VKPSA = '  '    "
                        + " AND B.VKPMANDANT = C.VKZMANDANT AND B.VKPAUFKRS = C.VKZAUFKRS AND B.VKPAUFLFD = C.VKZAUFLFD   "
                        + " AND B.VKPAUFPOS = C.VKZAUFPOS AND C.VKZSA = 'VK'  "
                        + " AND T.VVTMANDANT = W.WBBMANDANT AND T.VVTAUFKRS = W.WBBAUFKRS AND T.VVTAUFLFD = W.WBBAUFLFD "
                        + " AND T.VVTAUFPOS = W.WBBAUFPOS  AND T.VVTLIEFSCH = W.WBBALIEFSCH "
                        + " AND W.WBBMANDANT = S.WAMANDANT(+) AND W.WBBART = S.WAART(+) AND W.WBBVAR = S.WAVAR(+) "
                        + " AND T.VVTMANDANT = :VVTMANDANT: AND T.VVTAUFKRS = :VVTAUFKRS: AND T.VVTAUFLFD = :VVTAUFLFD: AND T.VVTLIEFSCH = :VVTLIEFSCH: "
                        + " order by vkpaufpos ";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

                    SResult = Connect2Proxy(or1);
                    break;

            }
         
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
       public DataSet QVVT07(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT NVL(CONTROL,'   ') AS CONTROL, P.*   FROM VVTLIEF P  "
                      + " LEFT JOIN ICC_WFEVENTS ON  MANDANT=VVTMANDANT  AND VVTAUFTYP=ORDTYPE AND  VVTAUFKRS =  KRS AND VVTAUFLFD = LFD AND VVTAUFPOS=POS AND WFEVENTS='MVVAPP              '"
                     + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTLIEFSCH=:VVTLIEFSCH: AND VVTAUFTYP=:VVTAUFTYP: AND  VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS:" 
                     + " ORDER BY VVTLIEFSCH DESC";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);

            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QVKPBYVVT(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT P.*   FROM VVTLIEF P  "
                     + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTLIEFSCH=:VVTLIEFSCH:"
                     + " ORDER BY VVTLIEFSCH DESC,VVTAUFKRS,VVTAUFLFD,VVTAUFPOS";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }
        public DataSet QGETPACKNR(DataRow dwData)
        {
            or1 = OracleDB.CreateCommand();
            or1.CommandText = "SELECT MAX(WBBPACKNR) AS WBBPACKNR   FROM VVTLIEF P  JOIN WBBST ON WBBMANDANT=VVTMANDANT AND WBBURLIEFSCH=VVTLIEFSCH "
                     + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTLIEFSCH=:VVTLIEFSCH:"
                     + " ORDER BY WBBPACKNR DESC";
            or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
            SResult = Connect2Proxy(or1);
            SResult.Tables[0].TableName = TableName;
            return SResult;
        }

     
        public void UpdateVVTLIEF(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            or1 = OracleDB.CreateCommand();
            if (option == 0)
            {
                switch (app.company)
                {
                    case "YGR":
                    case "YCC":
                    default:
                        option = 1;
                        break;
                    case "JLT":
                        option = 2;
                        break;
                }
            }
            switch (option)
            {
                case 1:
                    or1.CommandText = "UPDATE VVTLIEF SET VVTMANDANT=:VVTMANDANT:,VVTAUFTYP=:VVTAUFTYP:,VVTAUFKRS=:VVTAUFKRS:,VVTAUFLFD=:VVTAUFLFD:,VVTAUFPOS=:VVTAUFPOS:,VVTTEILNR=:VVTTEILNR:,VVTLOVON=:VVTLOVON:,VVTLOAN=:VVTLOAN:,VVTTEILNRAN=:VVTTEILNRAN:,VVTABHAENGIG=:VVTABHAENGIG:,VVTLOABH1=:VVTLOABH1:,VVTLOABH2=:VVTLOABH2:,VVTPRODST=:VVTPRODST:,VVTKZINLEXP=:VVTKZINLEXP:,VVTLAND=:VVTLAND:,VVTPLZ=:VVTPLZ:,VVTKUNDNRL=:VVTKUNDNRL:,VVTADRSLL=:VVTADRSLL:,VVTLIEFSCH=:VVTLIEFSCH:,VVTLIEFSCHPOS=:VVTLIEFSCHPOS:,VVTKUNDNRR=:VVTKUNDNRR:,VVTADRSLR=:VVTADRSLR:,VVTRENR=:VVTRENR:,VVTPFRENR=:VVTPFRENR:,VVTME=:VVTME:,VVTANZSTK=:VVTANZSTK:,VVTMTR=:VVTMTR:,VVTKG=:VVTKG:,VVTQM=:VVTQM:,VVTVOLUMEN=:VVTVOLUMEN:,VVTRUECKANZSTK=:VVTRUECKANZSTK:,VVTRUECKMTR=:VVTRUECKMTR:,VVTRUECKKG=:VVTRUECKKG:,VVTRUECKQM=:VVTRUECKQM:,VVTANZVP=:VVTANZVP:,VVT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DLIM=:VVTKREDLIM:,VVTSWING=:VVTSWING:,VVTRAITING=:VVTRAITING:,VVTVERSICH1=:VVTVERSICH1:,VVTVERSICH2=:VVTVERSICH2:,VVTVERSICH3=:VVTVERSICH3:,VVTVERSICH4=:VVTVERSICH4:,VVTVERSICH5=:VVTVERSICH5:,VVTVERSICH21=:VVTVERSICH21:,VVTVERSICH22=:VVTVERSICH22:,VVTVERSICH23=:VVTVERSICH23:,VVTVERSICH24=:VVTVERSICH24:,VVTVERSICH25=:VVTVERSICH25:,VVTKREDBIS=:VVTKREDBIS:,VVTKREDVON=:VVTKREDVON:,VVTLUEBKZ=:VVTLUEBKZ:,VVTFKNVS=:VVTFKNVS:,VVTFKSPTD=:VVTFKSPTD:,VVTFKSPRD=:VVTFKSPRD:,VVTROHGEW=:VVTROHGEW:,VVTFERGEW=:VVTFERGEW:,VVTZUSTAND=:VVTZUSTAND:,VVTARTGRP=:VVTARTGRP:,VVTARTABW=:VVTARTABW:,VVTAPOS=:VVTAPOS:,VVTAUFMSL=:VVTAUFMSL:,VVTZENSUR=:VVTZENSUR:,VVTPOSEXT=:VVTPOSEXT:,VVTKZZUTEI=:VVTKZZUTEI:,VVTAKKREDNR=:VVTAKKREDNR:,VVTKDKOMM=:VVTKDKOMM:,VVTCOVPRC=:VVTCOVPRC:,VVTUMSATZ=:VVTUMSATZ:,VVTZEUGNIS=:VVTZEUGNIS:,VVTRESKZ=:VVTRESKZ:,VVTFILLER1=:VVTFILLER1:"
                        + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND  VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 2:
                    or1.CommandText = "UPDATE VVTLIEF SET VVTMANDANT=:VVTMANDANT:,VVTAUFTYP=:VVTAUFTYP:,VVTAUFKRS=:VVTAUFKRS:,VVTA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TSETKZ=:VVTSETKZ:,VVTLOHNKD=:VVTLOHNKD:,VVTKOLL=:VVTKOLL:,VVTSANZSTK=:VVTSANZSTK:,VVTROHMTR=:VVTROHMTR:,VVTBRUTTO=:VVTBRUTTO:,VVTNETTO=:VVTNETTO:,VVTVERDERB=:VVTVERDERB:,VVTFOLGEMTR=:VVTFOLGEMTR:,VVTSOLLTEIL=:VVTSOLLTEIL:,VVTGEBNR=:VVTGEBNR:,VVTPROGRP=:VVTPROGRP:,VVTPLFDAT=:VVTPLFDAT:,VVTFBENID=:VVTFBENID:,VVTFDAT=:VVTFDAT:,VVTFZEIT=:VVTFZEIT:,VVTVBDAT=:VVTVBDAT:,VVTLIEFTERM=:VVTLIEFTERM:,VVTEILAUS=:VVTEILAUS:,VVTFRNETTO=:VVTFRNETTO:,VVTHUELTYP=:VVTHUELTYP:,VVTHUELGEW=:VVTHUELGEW:,VVTSPULEN=:VVTSPULEN:,VVTNETKG=:VVTNETKG:,VVTFEUCHTEI=:VVTFEUCHTEI:,VVTFEUCHTES=:VVTFEUCHTES:,VVTHGEWABZ=:VVTHGEWABZ:,VVTANZPA=:VVTANZPA:,VVTTARA=:VVTTARA:,VVTBRTGEW=:VVTBRTGEW:,VVTPACKTYP=:VVTPACKTYP:,VVTKREDLIM=:VVTKREDLIM:,VVTSWING=:VVTSWING:,VVTRAITING=:VVTRAITING:,VVTVERSICH1=:VVTVERSICH1:,VVTVERSICH2=:VVTVERSICH2:,VVTVERSICH3=:VVTVERSICH3:,VVTVERSICH4=:VVTVERSICH4:,VVTVERSICH5=:VVTVERSICH5:,VVTVERSICH21=:VVTVERSICH21:,VVTVERSICH22=:VVTVERSICH22:,VVTVERSICH23=:VVTVERSICH23:,VVTVERSICH24=:VVTVERSICH24:,VVTVERSICH25=:VVTVERSICH25:,VVTKREDBIS=:VVTKREDBIS:,VVTKREDVON=:VVTKREDVON:,VVTLUEBKZ=:VVTLUEBKZ:,VVTFKNVS=:VVTFKNVS:,VVTFKSPTD=:VVTFKSPTD:,VVTFKSPRD=:VVTFKSPRD:,VVTROHGEW=:VVTROHGEW:,VVTFERGEW=:VVTFERGEW:,VVTZUSTAND=:VVTZUSTAND:,VVTARTGRP=:VVTARTGRP:,VVTARTABW=:VVTARTABW:,VVTAPOS=:VVTAPOS:,VVTAUFMSL=:VVTAUFMSL:,VVTZENSUR=:VVTZENSUR:,VVTPOSEXT=:VVTPOSEXT:,VVTKZZUTEI=:VVTKZZUTEI:,VVTAKKREDNR=:VVTAKKREDNR:,VVTKDKOMM=:VVTKDKOMM:,VVTCOVPRC=:VVTCOVPRC:,VVTUMSATZ=:VVTUMSATZ:,VVTZEUGNIS=:VVTZEUGNIS:,VVTRESKZ=:VVTRESKZ:,VVTFILLER1=:VVTFILLER1:"
                        + " WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFTYP=:VVTAUFTYP: AND  VVTAUFKRS = :VVTAUFKRS: AND VVTAUFLFD = :VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: AND VVTLIEFSCH=:VVTLIEFSCH:";
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData);
                    break;
                case 3:
                    or1.CommandText = "UPDATE VVTLIEF SET(VVTMTR,VVTFORT,VVTRUECKMTR,VVTANZSTK,VVTRUECKANZSTK,VVTQM,VVTRUECKQM,VVTBRTGEW,VVTKG,VVTNETKG,VVTRUECKKG)=(SELECT NVL(SUM(WBBISTKLG * 0.001 * 100),0) AS VVTMTR,NVL(SUM(WBBISTKLG * 0.001 * 100 * 0.001),0) AS VVTFORT,NVL(SUM(WBBISTKLG * 0.001 * 100),0) AS VVTRUECKMTR,NVL(COUNT(*),0) AS VVTANZSTK,NVL(COUNT(*),0) AS VVTRUECKANZSTK,LPAD(NVL(SUM(WBBISTKLG * 0.001 * WBBSBRT * 0.001 * 0.01 * 100),0),10,'0') AS VVTQM,LPAD(NVL(SUM(WBBISTKLG * 0.001 * WBBSBRT * 0.001 * 0.01 * 100),0),10,'0') AS VVTRUECKQM,NVL(SUM(WBBSGEW * 0.001 * 100 * 0.1),0) AS VVTBRTGEW,LPAD(NVL(SUM(WBBSGEW * 0.001 * 100 * 0.1),0),10,'0') AS VVTKG,LPAD(NVL(SUM(WBBSGEW * 0.001 * 100 * 0.1),0),10,'0') AS VVTNETKG,LPAD(NVL(SUM(WBBSGEW * 0.001 * 100 * 0.1),0),10,'0') AS VVTRUECKKG"
                    + " FROM WBBST B WHERE VVTMANDANT=WBBMANDANT AND VVTAUFKRS=WBBAUFKRS AND VVTAUFLFD=WBBAUFLFD AND VVTAUFPOS=WBBAUFPOS AND VVTLIEFSCH=B.WBBURLIEFSCH)"
                    + "   WHERE VVTMANDANT=:VVTMANDANT: AND VVTAUFKRS=:VVTAUFKRS: AND VVTAUFLFD=:VVTAUFLFD: AND VVTAUFPOS=:VVTAUFPOS: AND VVTLIEFSCH=:VVTLIEFSCH:"
                   ;
                    or1.CommandText = INTEXDBC.InjectData(or1.CommandText, dwData); 
                    break;
                /* + "  AND EXISTS ( SELECT 1 FROM WBBST B WHERE VVTMANDANT=WBBMANDANT AND VVTAUFKRS=WBBAUFKRS AND VVTAUFLFD=WBBAUFLFD AND VVTAUFPOS=WBBAUFPOS AND VVTLIEFSCH=B.WBBURLIEFSCH  )"*/
            }
            Connect2Proxy(or1);
        } 
    }
}
